<% cache locale do %>
<div class="row"><div class="col-md-12">
  <h1 class="center"><%= t '.criteria' %></h1>
  <!-- This page quickly shows some information about the Criteria. -->
  <table class="table table-bordered table-striped table-responsive table-condensed">
    <tr>
      <th><%= t '.level' %></th>
      <th><%= t '.total_active' %></th>
      <th><%= t '.must' %></th>
      <th><%= t '.should' %></th>
      <th><%= t '.suggested' %></th>
      <th><%= t '.allow_na' %></th>
      <th><%= t '.met_justification_required' %></th>
      <th><%= t '.require_url' %></th>
      <th><%= t '.met_justification_or_url_required' %></th>
      <th><%= t '.details' %></th>
      <th><%= t '.new_this_level' %></th>
      <th><%= t '.future' %></th>
    </tr>
    <% previous_criteria = [] # For counting "new this level"
       Project::LEVEL_IDS.each do |level| %>
      <tr>
        <% future_criteria, active_criteria =
             Criteria[level].values.partition(&:future?) %>
        <td><%= t "projects.form_early.level.#{level}" %></td>
        <td><%= active_criteria.count %></td>
        <td><%= active_criteria.count(&:must?) %></td>
        <td><%= active_criteria.count(&:should?) %></td>
        <td><%= active_criteria.count(&:suggested?) %></td>
        <td><%= active_criteria.count(&:na_allowed?) %></td>
        <td><%= active_criteria.count(&:met_justification_required?) %></td>
        <td><%= active_criteria.count(&:met_url_required?) %></td>
        <td><%= active_criteria.count(&:met_justification_or_url_required?) %></td>
        <td><%= active_criteria.count(&:details_present?) %></td>
        <td><%=
          # We *only* consider active criteria for "new this level".
          new_criteria = active_criteria.map { |x| x.name } -
            previous_criteria
          new_criteria.length %></td>
        <% previous_criteria += new_criteria %>
        <td><%= future_criteria.count %></td>
      </tr>
    <% end %>
  </table>
  <p><%= t '.project_stats_html' %></p>
  <p><a href='/<%= locale %>/criteria'><%= t '.see_actual_criteria' %></a></p>
</div></div>
<% end %>
